#include <bits/stdc++.h>
#define re register
#define int long long

using namespace std;

const int N = 1e6 + 10,M = 2e6 + 10;
const int inf = 1e9 + 10;
int n;
bool ans[M];
vector<int> pt;
unordered_map<int,int> vis;

inline int read(){
    int r = 0,w = 1;
    char c = getchar();
    while (c < '0' || c > '9'){
        if (c == '-') w = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9'){
        r = (r << 1) + (r << 3) + (c ^ 48);
        c = getchar();
    }
    return r * w;
}

signed main(){
    freopen("mcmf.in","r",stdin);
    freopen("mcmf.out","w",stdout);
    n = read();
    for (re int i = 1,len,x;i <= n;i++){
        len = read();
        while (len--){
            vis[x = read()]++;
            pt.push_back(x);
            // cerr << arr[i] << " " << vis[arr[i]] << " !!!\n";
        }
    } sort(pt.begin(),pt.end()); pt.push_back(inf);
    pt.erase(unique(pt.begin(),pt.end()),pt.end());
    for (re int i = 0;i < pt.size();i++){
        int x = pt[i];
        if (!vis.count(x)) continue;
        int num = vis[x]; ans[x] = true;
        if (vis[x] <= 1) continue;
        int dis = pt[i + 1] - x;
        // cerr << x << " " << dis << " " << num << " ???\n";
        if (num >= dis) vis[pt[i + 1]] += (num - dis);
        for (re int p = x,j = 1;p < pt[i + 1] && j <= min(num,dis);p++,j++) ans[p] = true;
    }
    for (re int i = 2e6,fl = 0;i;i--){
        if (fl) printf("%lld",ans[i]);
        else{
            if (ans[i]) printf("%lld",fl = ans[i]);
        }
    }
    return 0;
}